import 'package:dio/dio.dart';
import 'package:flutter_enjoy_plus/constants/index.dart';
import 'package:flutter_enjoy_plus/utils/RequestDio.dart';

// 获取验证码
Future getCodeAPI(Map<String, dynamic> params) =>
    requestDio.get(HTTP_PATH.GET_CODE, params: params);

Future loginAPI(Map<String, dynamic> data) =>
    requestDio.post(HTTP_PATH.LOGIN, data: data);

// 刷新TOKEN
Future refreshTokenAPI() =>
    requestDio.post(HTTP_PATH.REFRESH_TOKEN);
  
// 获取用户信息
Future getUserInfoAPI() =>
    requestDio.get(HTTP_PATH.GET_USER_INFO);

// 上传
// 上传接口
Future<dynamic> uploadPhotoAPI(FormData data) =>
    requestDio.upload(HTTP_PATH.UPLOAD, data: data);

// 更新用户信息
Future updateUserInfoAPI(Map<String, dynamic> data) =>
    requestDio.put(HTTP_PATH.UPDATE_USER_INFO, data: data);
